<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:80:"/www/wwwroot/crm.liunuo.net/public/../application/user/view/customer/index.phtml";i:1552999926;s:60:"/www/wwwroot/crm.liunuo.net/application/user/view/base.phtml";i:1552999924;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title><?php echo config('website.site_name')?></title>
    <link rel="stylesheet" href="/static/libs/layui/css/layui.css">
    <link rel="stylesheet" href="/static/css/base.css">
    <link rel="stylesheet" href="/static/css/fonts.css">
    
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header layui-bg-black">
        <div class="layui-logo"><img src="/static/user/images/logo.png" class="head-logo"></div>
        <ul class="layui-nav layui-layout-left">
            <?php if(is_array($navbar) || $navbar instanceof \think\Collection || $navbar instanceof \think\Paginator): if( count($navbar)==0 ) : echo "" ;else: foreach($navbar as $key=>$v): ?>
            <li class="layui-nav-item <?php if(isset($breadcrumb['0']) and $breadcrumb['0'] == $v['name']): ?>layui-this<?php endif; ?>">
                <a href="<?php echo \think\Request::instance()->root(true); ?>/<?php if(empty($v['url'])): ?><?php echo $v['children']['0']['url']; else: ?><?php echo $v['url']; endif; ?>"><i class="<?php echo $v['icon']; ?>"></i> <?php echo $v['name']; ?></a>
            </li>
            <?php endforeach; endif; else: echo "" ;endif; ?>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item"><a href="/" target="_blank"><i class="fa fa-home"></i> 网站首页</a></li>
            <?php $remind_sum= today_remind_sum();?>
            <li class="layui-nav-item" style="text-align: right;"><a href="/user/customer/remind/"><i class="fa fa-bell"></i> 提醒消息 <span class="layui-badge"><?php echo $remind_sum['count']; ?></span></a></li>
            <li class="layui-nav-item">
                <a href="javascript:;"><i class="fa fa-user"></i> <?php if(session('user_auth.realname')): ?><?php echo session('user_auth.realname'); else: ?><?php echo session('user_auth.username'); endif; ?></a>
                <dl class="layui-nav-child">
                    <dd><a href="<?php echo url('user/index/editPassword'); ?>">修改密码</a></dd>
                    <dd><a href="<?php echo url('user/index/logout'); ?>">退出登录</a></dd>
                </dl>
            </li>
        </ul>
    </div>
    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <ul class="layui-nav layui-nav-tree">
                <li class="layui-nav-item"><a href="<?php echo url('user/index/index'); ?>"><i class="fa fa-home fa-fw"></i> 系统首页</a></li>
                <?php if(is_array($navbar) || $navbar instanceof \think\Collection || $navbar instanceof \think\Paginator): if( count($navbar)==0 ) : echo "" ;else: foreach($navbar as $key=>$n0): if(isset($n0['children']) and isset($breadcrumb['0']) and $breadcrumb['0'] == $n0['name']): if(is_array($n0['children']) || $n0['children'] instanceof \think\Collection || $n0['children'] instanceof \think\Paginator): if( count($n0['children'])==0 ) : echo "" ;else: foreach($n0['children'] as $key=>$n1): ?>
                <li class="layui-nav-item <?php if(isset($breadcrumb['1']) and $breadcrumb['1'] == $n1['name']): if(isset($n1['children'])): ?>layui-nav-itemed<?php else: ?>layui-this<?php endif; endif; ?>">
                    <a href="<?php if(isset($n1['children'])): ?>javascript:;<?php else: ?><?php echo \think\Request::instance()->root(true); ?>/<?php echo $n1['url']; endif; ?>"><i class="<?php echo $n1['icon']; ?> fa-fw"></i> <?php echo $n1['name']; ?></a>
                    <?php if(isset($n1['children'])): ?>
                    <dl class="layui-nav-child">
                        <?php if(is_array($n1['children']) || $n1['children'] instanceof \think\Collection || $n1['children'] instanceof \think\Paginator): if( count($n1['children'])==0 ) : echo "" ;else: foreach($n1['children'] as $key=>$n2): ?>
                        <dd<?php if(isset($breadcrumb['2']) and $breadcrumb['2'] == $n2['name']): ?> class="layui-this"<?php endif; ?>><a href="<?php echo \think\Request::instance()->root(true); ?>/<?php echo $n2['url']; ?>"><?php echo $n2['name']; ?></a></dd>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </dl>
                    <?php endif; ?>
                </li>
                <?php endforeach; endif; else: echo "" ;endif; endif; endforeach; endif; else: echo "" ;endif; ?>
            </ul>
        </div>
    </div>
    <div class="layui-breadcrumb">
        <?php if(isset($breadcrumb)): if(is_array($breadcrumb) || $breadcrumb instanceof \think\Collection || $breadcrumb instanceof \think\Paginator): if( count($breadcrumb)==0 ) : echo "" ;else: foreach($breadcrumb as $key=>$v): ?>
        <a><cite><?php echo $v; ?></cite></a>
        <?php endforeach; endif; else: echo "" ;endif; endif; ?>
    </div>
    <div class="layui-body">
        
<div class="layui-card">
    <div class="layui-card-header">
        <form action="<?php echo url('user/customer/index'); ?>" class="layui-form" method="get">
            <div class="layui-form-item">
                <div class="layui-input-inline">
                    <input type="text" name="cname" value="<?php echo input('cname'); ?>" autocomplete="off" placeholder="请输入客户名称" class="layui-input"/>
                </div>
                <div class="layui-input-inline">
                    <select name="type">
                        <option value=""><?php echo user_config_totitle('type','customer'); ?></option>
                        <?php $_5c90e71419bec=parse_attr($type['options']); if(is_array($_5c90e71419bec) || $_5c90e71419bec instanceof \think\Collection || $_5c90e71419bec instanceof \think\Paginator): if( count($_5c90e71419bec)==0 ) : echo "" ;else: foreach($_5c90e71419bec as $i=>$j): ?>
                        <option value="<?php echo $i; ?>" <?php if(input('?type') and (input('type') == $i)): ?> selected="selected"<?php endif; ?>><?php echo $j; ?></option>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>
                </div>
                <div class="layui-input-inline">
                    <select name="intention">
                        <option value=""><?php echo user_config_totitle('intention','customer'); ?></option>
                        <?php $_5c90e71419b89=parse_attr($intention['options']); if(is_array($_5c90e71419b89) || $_5c90e71419b89 instanceof \think\Collection || $_5c90e71419b89 instanceof \think\Paginator): if( count($_5c90e71419b89)==0 ) : echo "" ;else: foreach($_5c90e71419b89 as $i=>$j): ?>
                        <option value="<?php echo $i; ?>" <?php if(input('?intention') and (input('intention') == $i)): ?> selected="selected"<?php endif; ?>><?php echo $j; ?></option>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>
                </div>
                <div class="layui-input-inline">
                    <select name="come_from">
                        <option value=""><?php echo user_config_totitle('come_from','customer'); ?></option>
                        <?php $_5c90e71419b24=parse_attr($come_from['options']); if(is_array($_5c90e71419b24) || $_5c90e71419b24 instanceof \think\Collection || $_5c90e71419b24 instanceof \think\Paginator): if( count($_5c90e71419b24)==0 ) : echo "" ;else: foreach($_5c90e71419b24 as $i=>$j): ?>
                        <option value="<?php echo $i; ?>" <?php if(input('?come_from') and (input('come_from') == $i)): ?> selected="selected"<?php endif; ?>><?php echo $j; ?></option>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>
                </div>
                <div class="layui-input-inline">
                    <select name="status">
                        <option value=""><?php echo user_config_totitle('status','customer'); ?></option>
                        <?php $_5c90e71419ab8=parse_attr($status['options']); if(is_array($_5c90e71419ab8) || $_5c90e71419ab8 instanceof \think\Collection || $_5c90e71419ab8 instanceof \think\Paginator): if( count($_5c90e71419ab8)==0 ) : echo "" ;else: foreach($_5c90e71419ab8 as $i=>$j): ?>
                        <option value="<?php echo $i; ?>" <?php if(input('?status') and (input('status') == $i)): ?> selected="selected"<?php endif; ?>><?php echo $j; ?></option>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>
                </div>
                <div class="layui-input-inline">
                    <button class="layui-btn layui-btn-primary ajax-search"><i class="fa fa-search"></i></button>
                </div>
            </div>
        </form>
    </div>
    <div class="layui-card-body">
        <div class="layui-btn-group">
            <a href="<?php echo url('user/customer/add'); ?>" class="layui-btn"><i class="fa fa-plus-circle"></i> 新增客户</a>
            <!--a href="#" class="layui-btn layui-btn-danger ajax-batch"><i class="fa fa-trash-o"></i> 批量转移</a-->
            <a href="<?php echo url('user/customer/index'); ?>" class="layui-btn layui-btn-normal"><i class="fa fa-user"></i> 全部客户</a>
            <a href="<?php echo url('user/customer/index',['screen' => 'star']); ?>" class="layui-btn layui-btn-primary"><i class="fa fa-star"></i> 重要客户</a>
            <a href="<?php echo url('user/customer/index',['screen' => 'today_add']); ?>" class="layui-btn layui-btn-primary"><i class="fa fa-star"></i> 今日新增</a>
            <a href="<?php echo url('user/customer/index',['screen' => 'today_track']); ?>" class="layui-btn layui-btn-primary"><i class="fa fa-star"></i> 今日跟进过</a>
            <a href="<?php echo url('user/customer/index',['screen' => '30day_notrack']); ?>" class="layui-btn layui-btn-primary"><i class="fa fa-star"></i> 30天未跟进</a>
            <a href="<?php echo url('user/customer/index',['screen' => 'notrack']); ?>" class="layui-btn layui-btn-primary"><i class="fa fa-star"></i> 从未跟进</a>
        </div>
		<table class="layui-table layui-form" lay-filter="customer">
			<thead>
				<tr>
                                        <th><?php echo user_config_totitle('intention','customer'); ?></th>
					<th>客户名称</th>
					<th>手机号码</th>
					<th lay-data="{field:'province',sort: true}">区域</th>
					<th lay-data="{field:'address'}">地址</th>
					<th lay-data="{field:'type',sort: true}"><?php echo user_config_totitle('type','customer'); ?></th>
                                        <th lay-data="{field:'come_from',sort: true}"><?php echo user_config_totitle('come_from','customer'); ?></th>
					<th lay-data="{field:'create_time',sort: true}">创建时间</th>
                                        <th lay-data="{field:'update_time',sort: true}">更新时间</th>
					<th lay-data="{field:'status',sort: true}"><?php echo user_config_totitle('status','customer'); ?></th>
                                        <th lay-data="{field:'uid',sort: true}">操作人</th>
					<th lay-data="{field:'setting',sort: true}">操作</th>
				</tr>
			</thead>
			<tbody>
				<?php if(is_array($list) || $list instanceof \think\Collection || $list instanceof \think\Paginator): if( count($list)==0 ) : echo "$empty" ;else: foreach($list as $key=>$v): ?>
				<tr>
					<td><?php echo user_config_toval('intention',$v['intention'],'customer'); ?></td>
                                        <td><?php echo $v['cname']; ?></td>
					<td><?php echo $v['mobile']; ?></td>
                                        <td><?php echo $v['province']; ?>/<?php echo $v['city']; ?>/<?php echo $v['area']; ?></td>
                                        <td><?php echo $v['address']; ?></td>
                                        <td><?php echo user_config_toval('type',$v['type'],'customer'); ?></td>
                                        <td><?php echo user_config_toval('come_from',$v['come_from'],'customer'); ?></td>
					<td><?php echo time_trans($v['create_time']); ?></td>
                                        <td><?php echo time_trans($v['update_time']); ?></td>
                                        <td><?php echo user_config_toval('status',$v['status'],'customer'); ?></td>
                                        <td><?php echo get_user_realname($v['uid']); ?></td>
					<td>
                                            <a href="<?php echo url('user/customer/show', ['id' => $v['id']]); ?>" class="layui-btn layui-btn-xs layui-btn-normal"><i class="fa fa-desktop"></i> 查看</a>
                                            <a href="<?php echo url('user/customer/edit', ['id' => $v['id']]); ?>" class="layui-btn layui-btn-xs layui-btn-normal"><i class="fa fa-edit"></i> 编辑</a>
                                            <a href="<?php echo url('user/customer/del', ['id' => $v['id']]); ?>" class="layui-btn layui-btn-xs layui-btn-danger ajax-delete"><i class="fa fa-trash-o"></i> 删除</a>
					</td>
				</tr>
				<?php endforeach; endif; else: echo "$empty" ;endif; ?>
			</tbody>
		</table>
		<div class="page"><?php echo $list->render(); ?></div>
	</div>
</div>

    </div>
</div>

<script src="/static/libs/layui/layui.all.js"></script>
<script src="/static/js/jquery.min.js"></script>
<script src="/static/js/layui.base.js"></script>
<script src="/static/js/multiSelect.js"></script>
<script src="/static/js/common.js"></script>

<?php if($remind_sum['web'] > '0'): ?>
<script type="text/javascript">
    layer.msg('今日您有 <?php echo $remind_sum['count']; ?> 条信息待处理', {
            offset:'t',
            time: 5000, //不自动关闭
            btn: ['立即处理', '稍后处理'],
            yes: function(index){
                layer.close(index);
                window.location.href='/user/customer/remind/';
            }
        }
    );
</script>
<?php endif; ?>
</body>
</html>